This invention relates generally to processing within a computing environment, and more particularly to declarative schema-directed data model management.
Web applications typically use forms to collect data and store that data in a database. Extensible markup language (XML) is often used to store and transmit data to and from web applications. Through the use of an XML schema, data within an XML document may be validated. Web applications that collect XML data can be designed to be conformant to an XML schema. The XML Schema often has optional subtree elements or a choice of alternative subtree elements.
One example is that of a payment detail component of a transaction data definition. A “payment” element may include a first sub-element for a “payment type” such as collect on delivery (COD), credit card, bank direct payment card, etc. These payment detail element choices would allow storage of a customer ID for COD or card number, expiry and other info for credit card, etc. According to the XML schema, the payment element of the XML document is not considered valid if payment detail elements corresponding to both the COD and credit card options appeared within it.
Managing these choice and optional nodes creates a compromise between server side manipulation of data, and the removal of data leading to an inconsistent user experience on the client side. Both approaches lead to additional development work, additional maintenance and/or negative customer experience impact.